<?php
/* @var $this OrderheaderController */
/* @var $model Orderheader */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'orderheader-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		
<?php echo $form->labelEx($model,'date'); ?>
                <?php 
   $form->widget('zii.widgets.jui.CJuiDatePicker', array(
        'model'=>$model,
        'attribute'=>'date',
        'name'=>$model->date, 
        'value'=>$model->date,
        'options'=>array('dateFormat'=>'yy-mm-dd', 
                        'altFormat'=>'dd-mm-yy', 
                                                'showAnim'=>'fold',
                        'changeMonth'=>'true', 
                        'changeYear'=>'true', 
                        'yearRange'=>'1995:2015', 
                        'showOn'=>'both',
                        'buttonText'=>'...'),
        'htmlOptions'=>array('size'=>'10')
   ));
  ?>
                <?php echo $form->error($model,'date'); ?>
        </div>


	<div class="row">
		<?php echo $form->labelEx($model,'patient_id'); ?>
                <?php echo $form->dropDownList ($model, 'patient_id', CHtml::listData(
                Patient::model()->findAll(), 'id','patient_lastname'),
                        array('prompt' => 'Select a patient')
                        ); ?>
                <?php echo $form->error($model,'patient_id'); ?>
        </div>

	<div class="row">
		<?php //echo $form->labelEx($model,'order_total'); ?>
		<?php //echo $form->textField($model,'order_total',array('size'=>10,'maxlength'=>10)); ?>
		<?php //echo $form->error($model,'order_total'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'pharmacy_id'); ?>
		<?php echo $form->dropDownList ($model, 'pharmacy_id', CHtml::listData(
                Pharmacy::model()->findAll(), 'id','pharmacy_name'),
                        array('prompt' => 'Select a pharmacy')
                        ); ?>
                <?php echo $form->error($model,'pharmacy_id'); ?>
        </div>
	<div class="row">
		<?php echo $form->labelEx($model,'employee_id'); ?>
                <?php echo $form->dropDownList ($model, 'employee_id', CHtml::listData(
                Employee::model()->findAll(), 'id','emp_lastname'),
                        array('prompt' => 'Select an employee')
                        ); ?>
                <?php echo $form->error($model,'employee_id'); ?>
        </div>

	<div class="row">
	<?php echo $form->labelEx($model,'prescriptionheader_id'); ?>
                <?php echo $form->dropDownList ($model, 'prescriptionheader_id', CHtml::listData(
                Prescriptionheader::model()->findAll(), 'id','id'),
                        array('prompt' => 'Select a prescriptionheader')
                        ); ?>
                <?php echo $form->error($model,'prescriptionheader_id'); ?>
        </div>
		
	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->